<?php
include('../fns_all.php');

function get_all_users_ordered_by_date(){
	$cxn = db_connect();
	$query = " SELECT * FROM users order by create_date desc ";
	$result = mysqli_query($cxn, $query) or die('Error, get_all_users_ordered_by_date failed');
	return $result;
}



function get_single_user($id){
	$cxn = db_connect();
	$query = " SELECT * FROM users where id='$id' order by create_date desc ";
	$result = mysqli_query($cxn, $query) or die('Error, get_single_user failed');
	return $result;
}

function change_user_rank($id, $rank){
	$cxn = db_connect();
	mysqli_query($cxn, "update users set rank='$rank' WHERE id='$id'");
}
?>
